import http from "@/utils/request";
export default {
  /**
   * 获取订单列表
   * @param params
   * @return {AxiosPromise<any>}
   */
  async getOrderListApi(params) {
    return http.get("api/order/list", params);
  },
  /**
   * 获取订单列表
   * @param params
   * @return {AxiosPromise<any>}
   */
  async getOrderListByUserIdApi(params) {
    return http.get("api/order/listByUserId", params);
  },
  /**
   * 添加订单
   * @param params
   * @return {Promise<返回值>}
   */
  async addOrderApi(params) {
    return http.post("api/order/add", params);
  },
  /**
   * 发货
   * @param params
   * @return {AxiosPromise<any>}
   */
  async sendOrderApi(params) {
    return http.put("api/order/send", params);
  },
  /**
   * 发货
   * @param params
   * @return {AxiosPromise<any>}
   */
  async payOrderApi(params) {
    return http.put("api/order/pay", params);
  },
  /**
   * 确认收货
   * @param params
   * @return {Promise<void>}
   */
  async submitOrderApi(params) {
    return http.put("api/order/submit", params);
  },
  /**
   * 删除订单
   * @param params
   * @return {AxiosPromise<any>}
   */
  async deleteOrderApi(params) {
    return http.delete("api/order/delete", params);
  },
}
